package demo3;

/**
 * @Author 12629
 * @Description：
 */
public class Test {

    public static void main(String[] args) {
        Object obj = new Person("zhangsan");
        Object obj2 = new String("fsdafa");
        System.out.println(func(obj));
    }

    public static String func(Object obj) {
        return obj.toString();
    }

    public static void main3(String[] args) throws CloneNotSupportedException{
        Person person1 = new Person("zhagnsan");
        Person person2 = (Person)person1.clone();

        System.out.println(person1.m.money);
        System.out.println(person2.m.money);

        System.out.println("=====");

        person2.m.money = 99.9;

        System.out.println(person1.m.money);
        System.out.println(person2.m.money);

    }
    public static void main1(String[] args) throws CloneNotSupportedException{
        Person person1 = new Person("zhagnsan");
        Person person2 = (Person)person1.clone();

        person2.name = "gaobo";

        System.out.println(person1);
        System.out.println(person2);
    }
}
